<html>
<head>
<meta charset="UTF-8">
<title>系统应用信息列表</title>
	<link id="easyuiTheme" href="../../static/easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css"/>
	<link href="../../static/easyui/themes/icon.css" rel="stylesheet" type="text/css"/>
	<script src="../../static/easyui/jquery.min.js" type="text/javascript"></script>
	<script src="../../static/easyui/jquery.cookie.js" type="text/javascript"></script>
	<script src="../../static/easyui/ui-theme.js" type="text/javascript"></script>
	<script src="../../static/easyui/jquery.easyui.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../static/easyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
	<script src="../../static/plugin/assets/jslib.util.js" type="text/javascript"></script>
	<script src="../../static/plugin/assets/jslib.jquery.ajax.js" type="text/javascript"></script>
	<script src="../../static/plugin/assets/jslib.easyui.util.js" type="text/javascript"></script>
	<script src="../../ffres/dict/all.js" type="text/javascript"></script>
	<link href="../../static/easyui/themes/frameless.css" rel="stylesheet" type="text/css"/>
	<a href="" target="_blank" id="commonLink" name="commonLink"></a>
<script type="text/javascript">
	var subsCode = $.getUrlParam('subsCode');
	function doAdd(){
		JLEUtil.createModalWin('新增', 'SysAppsInfoAdd.html?subsCode='+subsCode);
	}
	
	function doUpdate() {
		var row = $('#dg').datagrid('getSelected');
		if (row){
			JLEUtil.createModalWin('修改', 'SysAppsInfoUpdate.html?' + 'appId=' + row.appId+'&subsCode='+row.subsCode+'&appCode='+row.appCode+'&appName='+row.appName);
		} else {
			$.messager.alert('提示','请选择一条记录！','info');
		}
	}
	
	function doDelete(){
		var row = $('#dg').datagrid('getSelected');
		if (row) {
			$.messager.confirm('删除提示', '你确定要删除这条记录?', function(r){
				if (r){

					var jsonData = JSON.parse('{'+'"appId":"' + row.appId + '"'+','+'"appCode":"'+row.appCode+'"'+'}');
					$.restfulDelete('../../api/sys/apps/info/delete', jsonData, function(data) {
						$.messager.alert('提示','记录删除成功!','info');
						$('#dg').datagrid('reload');
					});
				}
			});
		} else {
			$.messager.alert('提示','请选择一条记录！','info');
		}
	}

	function doView(){
		var row = $('#dg').datagrid('getSelected');
		if (row) {
			JLEUtil.createModalWin('详情','SysAppsInfoView.html?' + '&appId=' + row.appId);
		} else {
			$.messager.alert('提示','请选择一条记录！','info');
		}
	}	

	function reloadList(){
		$('#dg').datagrid('reload');
		JLEUtil.closewin();
	};

	function queryList(){
		var appCode=document.getElementById("appCode").value;
		var appName=document.getElementById("appName").value;
		$('#dg').datagrid({
			queryParams: {
				subsCode: subsCode,
				appCode:appCode,
				appName:appName
			}
		});
		$('#dg').datagrid({url : '../../api/sys/apps/infos/'})
	}
	$(function(){
		var subsCode = $.getUrlParam("subsCode");
		$('#dg').datagrid({
			queryParams: {
				subsCode: subsCode
			}
		});
		$('#dg').datagrid({url : '../../api/sys/apps/infos/'})
	});
</script>
</head>
<body class="easyui-layout">
<div data-options="region:'north',title:''" style="height: 40px;">
	<form id="searchForm">
		<table>
			<tr>
				<td class="searchTd">&nbsp;应用代码：</td>
				<td><input name="appCode" id="appCode"/></td>
				<td class="searchTd">&nbsp;应用名称：</td>
				<td><input name="appName" id="appName"/></td>
				<td><a class="easyui-linkbutton" href="javascript:void(0);" onclick="queryList()">查找</a></td>
				<td><a class="easyui-linkbutton" href="javascript:void(0);" onclick="JLEUtil.clearForm('searchForm');">清空</a></td>
			</tr>
		</table>
	</form>
</div>
<div data-options="region:'center',split:false">
<table id="dg" class="easyui-datagrid" title="" style="width:100%;height:95%"
			data-options="singleSelect:true,collapsible:true,method:'post'"
			toolbar="#tb"
		title="Load Data" 
		rownumbers="true" pagination="true" pageSize="20">
		<thead>
			<tr>
				<th data-options="field:'appId',resizable:true" hidden="true" >应用标识</th>
				<th data-options="field:'appCode',resizable:true" >应用代码</th>
				<th data-options="field:'appName',resizable:true" >应用名称</th>
				<th data-options="field:'archType',resizable:true" formatter="formatter_ARCH_TYPE">架构类型</th>
				<th data-options="field:'appVersion',resizable:true" >应用版本</th>
				<th data-options="field:'appOrder',resizable:true" >应用排列顺序</th>
				<th data-options="field:'gitUrl',resizable:true" >GIT仓库路径</th>
				<th data-options="field:'jdkVersion',resizable:true" formatter="formatter_JDK_VERSION">JDK版本</th>
				<th data-options="field:'appDesc',resizable:true" >应用说明</th>
				<th data-options="field:'subsCode',resizable:true" >所属系统</th>
				<th data-options="field:'createUser',resizable:true" >创建人</th>
				<th data-options="field:'createTime',resizable:true" >创建时间</th>
				<th data-options="field:'lastUpdateUser',resizable:true" >最后修改人</th>
				<th data-options="field:'lastUpdateTime',resizable:true" >最后更新时间</th>
			</tr>
		</thead>
	</table>
</div>
<div id="tb" style="padding:1px">
	<div style="margin-bottom:2px">
		<a href="javascript:doAdd()" class="easyui-linkbutton" iconCls="icon-add" plain="true">登记</a>
		<a href="javascript:doUpdate()" class="easyui-linkbutton" iconCls="icon-edit" plain="true">修改</a>
		<a href="javascript:doDelete()" class="easyui-linkbutton" iconCls="icon-remove" plain="true">删除</a>
		<a href="javascript:doView()" class="easyui-linkbutton" iconCls="icon-ok" plain="true">查看</a>
	</div>
</div>
</body>
</html>
